﻿using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;

public partial class mstLogin : MasterPage
{
    #region Functions

    protected override void OnInit(EventArgs e)
    {
        if (Session["Branding"] == null)
        {
            //  Temporary.
            //  ToDo    :   The User's Session has expired, redirect to the Login Screen.
            Response.Redirect("~/Branding/Select.aspx");
        }
        else
        {
            string sStylesheetURL = string.Concat("~/Branding/", Session["Branding"], "/Stylesheets/Login.css");

            HtmlLink hlStylesheet = new HtmlLink();
            hlStylesheet.Href = sStylesheetURL;
            hlStylesheet.Attributes.Add("rel", "Stylesheet");
            hlStylesheet.Attributes.Add("type", "text/css");

            Page.Header.Controls.Add(hlStylesheet);
        }
    }

    #endregion
}